Subject: Re: DisplayLib Fades
From: Martin Kift <[email-masked]>
To: James Savage <[email-masked]>
Cc: [email-masked]
Date: Fri, 26 Aug 1994 09:17:47 GMT0BST

> I've just been messing with DisplayLib and I can set up a 320x256x8
> display, but I really want to fade a bitmap on and off it. FadeIn and
> FadeOut don't work, is there an alternative?

Use the RIBlitzLibs commands PalInfo and PalAdjust. HAng on, I'll try 
and write some code now, although its bound not to work since I don't 
have my manual in front of me. 8) SOrry for mistakes, but I'm sure 
Steve will correct me if I get it wrong, he loves doing that 8)

; I always render to a separate pal, to maintain the original
; although you can do this in one pal if you want. If you render
; to a separate pal, make sure it has the same number of colours.

; the delay param should be a small number. You can also change the
; rate by altering the step number, I typically use 0.02 or 4 etc

; remember to have your bitmap set to black first. Looks nicer.
statement MyFadeIn{coplist.b,srcpal.w,targetpal.w,delay.w}
  PalInfo srcpal

  for i=0 to 1 step 0.01
    PalAdjust i,targetpal
    DisplayPalette coplist,targetpal
    vwait delay
  next i
end statement

statement MyFadeOut{coplist.b,srcpal.w,targetpal.w,delay.w}
  PalInfo srcpal

  for i=1 to 0 step -0.01
    PalAdjust i,targetpal
    DisplayPalette coplist,targetpal
    vwait delay
  next i
end statement

+---------------------------------+---------------------------------------+
| Martin Kift                     |   Software developer (C/C++/OWL/MFC)  |
| Email: [email-masked]   |   Procede Software Ltd., UK.          |
+---------------------------------+---------------------------------------+